package com.cogent.report.domain;

import java.util.Iterator;
import java.util.List;

public class ReportDomain {
	private String id;
	private String reporttitle;
	private String cn;
	private String resourcecode;
	private String access;
	private String staticcn;
	private String code;
	private String unit;
	private String amountunit;
	private String type;
	private String linkurl;
	private boolean iscache;
	private String statdistrictcode;
	private String sql;
	private List<ReportSearchFieldDomain>searchFieldList;
	private List<ReportSchemaFieldDomain>schemaFieldList;
	private List<ReportDisplayFieldDomain>displayFieldList;
	private List<ReportOrderFieldDomain>orderFieldList;
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getReporttitle() {
		return reporttitle;
	}
	public void setReporttitle(String reporttitle) {
		this.reporttitle = reporttitle;
	}
	public String getCn() {
		return cn;
	}
	public void setCn(String cn) {
		this.cn = cn;
	}
	public String getResourcecode() {
		return resourcecode;
	}
	public void setResourcecode(String resourcecode) {
		this.resourcecode = resourcecode;
	}
	public String getAccess() {
		return access;
	}
	public void setAccess(String access) {
		this.access = access;
	}
	public String getStaticcn() {
		return staticcn;
	}
	public void setStaticcn(String staticcn) {
		this.staticcn = staticcn;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getUnit() {
		return unit;
	}
	public void setUnit(String unit) {
		this.unit = unit;
	}
	public String getAmountunit() {
		return amountunit;
	}
	public void setAmountunit(String amountunit) {
		this.amountunit = amountunit;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getLinkurl() {
		return linkurl;
	}
	public void setLinkurl(String linkurl) {
		this.linkurl = linkurl;
	}
	public boolean isIscache() {
		return iscache;
	}
	public void setIscache(boolean iscache) {
		this.iscache = iscache;
	}
	public String getStatdistrictcode() {
		return statdistrictcode;
	}
	public void setStatdistrictcode(String statdistrictcode) {
		this.statdistrictcode = statdistrictcode;
	}
	public String getSql() {
		return sql;
	}
	public void setSql(String sql) {
		this.sql = sql;
	}
	public List<ReportSearchFieldDomain> getSearchFieldList() {
		return searchFieldList;
	}
	public void setSearchFieldList(List<ReportSearchFieldDomain> searchFieldList) {
		this.searchFieldList = searchFieldList;
	}
	public List<ReportSchemaFieldDomain> getSchemaFieldList() {
		return schemaFieldList;
	}
	public void setSchemaFieldList(List<ReportSchemaFieldDomain> schemaFieldList) {
		this.schemaFieldList = schemaFieldList;
	}
	public List<ReportDisplayFieldDomain> getDisplayFieldList() {
		return displayFieldList;
	}
	public void setDisplayFieldList(List<ReportDisplayFieldDomain> displayFieldList) {
		this.displayFieldList = displayFieldList;
	}
	public List<ReportOrderFieldDomain> getOrderFieldList() {
		return orderFieldList;
	}
	public void setOrderFieldList(List<ReportOrderFieldDomain> orderFieldList) {
		this.orderFieldList = orderFieldList;
	}
	public String getOrderSelect(String curvalue) {
		StringBuffer str = new StringBuffer();
		str.append("<select name=\"query_order\", id=\"query_order\" class=\"input_middle\">");
		str.append("<option value=\"\">请选择</option>");
		Iterator it = orderFieldList.iterator();
		while(it.hasNext()) {
			ReportOrderFieldDomain orderDomain = (ReportOrderFieldDomain)it.next();
			str.append("<option value=\"").append(orderDomain.getDbfield()).append("\"");
			if(curvalue.equals(orderDomain.getDbfield()))
				str.append(" selected=\"selected\"");
			str.append(">").append(orderDomain.getCn()).append("</option>");
		}
		str.append("</select>");
		
		return str.toString();
	}
}
